#!/bin/bash

#参考文档：https://ranchermanager.docs.rancher.com/zh/pages-for-subheaders/install-upgrade-on-a-kubernetes-cluster


#需要先装好cert-manager，执行 cert-manager/install.sh 脚本即可


#helm repo add rancher-stable https://releases.rancher.com/server-charts/stable
helm repo add rancher-latest https://releases.rancher.com/server-charts/latest

# 更新本地 Helm Chart 仓库缓存
helm repo update

kubectl create namespace cattle-system


helm install rancher rancher-latest/rancher \
  --namespace cattle-system \
  --set hostname=rancher.my.org \
  --set bootstrapPassword=admin \
  --version 2.7.0


#报错：Error: INSTALLATION FAILED: chart requires kubeVersion: < 1.25.0-0 which is incompatible with Kubernetes v1.26.5
#暂时不用想了，2.7不支持高版本的k8s
